home *** CD-ROM | disk | FTP | other *** search
/ Word Play Farm / Word Play Farm.iso / pc / wordplay.exe / wordplay.DXR / 00025_Drive Letter Routines.ls < prev    next >
Encoding:
Text File  |  1996-06-05  |  1.1 KB  |  48 lines

  1. on RunFromCD theFileName
  2.   set drive to char 1 of the pathName
  3.   set thispath to string(drive & ":\" & theFileName)
  4.   set myFile to FileIO(mnew, "READ", thispath)
  5.   if objectp(myFile) then
  6.     myFile(mdispose)
  7.     put "From the CD with the path " & drive
  8.     return drive & ":"
  9.     exit
  10.   else
  11.     InitFileIO()
  12.     set drive to CdReadFile()
  13.     CloseFileIO()
  14.     put "From the Hard drive with the path " & drive
  15.     return drive & ":"
  16.     exit
  17.   end if
  18.   alert("Please check that" && QUOTE & theFileName & QUOTE && "is on your CD drive.")
  19. end
  20.  
  21. on InitFileIO
  22.   global gReadBuffer
  23.   set gReadBuffer to FileIO(mnew, "read", the pathName & "word.cfg")
  24.   if objectp(gReadBuffer) <> 1 then
  25.     put "Can't find anything!"
  26.     alert("Cannot find CD or installation directory.  Please re-install")
  27.     quit()
  28.   end if
  29. end
  30.  
  31. on CdReadFile
  32.   global gReadBuffer
  33.   set theText to gReadBuffer(mReadLine)
  34.   set theText to gReadBuffer(mReadLine)
  35.   return char 2 of theText
  36. end
  37.  
  38. on CloseFileIO
  39.   global gReadBuffer
  40.   gReadBuffer(mdispose)
  41. end
  42.  
  43. on stopMovie
  44.   if objectp(gReadBuffer) then
  45.     gReadBuffer(mdispose)
  46.   end if
  47. end
  48.